import { _decorator, Component, Node, SpriteFrame, Sprite, resources } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {

    private _Image: Node
    onLoad() {
        this._Image = this.node.getChildByName("Image")
        let sprite = this._Image.getComponent(Sprite)
        resources.load("texture/b/spriteFrame", SpriteFrame, (err, data) => {
            if (!err) {
                sprite.spriteFrame = data;
            } else {
                console.log(`err:${err}}`)
            }
        })
    }
}

